<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>兄弟选择器</title>
		<style>
			.li1~li {
				color: red;
			}
			
			.li2+li {
				color: green;
			}
		</style>
	</head>
	<body>
		<ul>
			<li>1</li>
			<li>2</li>
			<li class="li1">目标</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
		
		<ul>
			<li>1</li>
			<li>2</li>
			<li class="li2">目标</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
	</body>
</html>